#!/bin/bash
#This script written by MJV 7/29/2013
#This script is intended to be run from the crontab once every five minutes.
#It will check to see if the connection with VZW is established (e.g. see
#if this computer has an IP address). Next, is it lacks an IP address, it 
#will run the wvdial program, and waits to be called again.
#VARIABLE TELLING US POSITION OF THIS SCRIPT
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
inetstatus=`ifconfig | grep 'inet addr' | grep -v '127.0.0.1' | wc -l`
if [[ $inetstatus == 0 ]]; then
{

	wvdial 1>> ${DIR}/../Data/CARBLogger.log 2>> ${DIR}/../Data/CARBLogger.log &

}
else
{
	:
}
fi  
exit
